package com.ruoyi.health.report.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.PrimaryKeyIdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.health.report.mapper.HealthAnalysisResultMapper;
import com.ruoyi.health.api.domain.HealthAnalysisResult;
import com.ruoyi.health.report.service.IHealthAnalysisResultService;

/**
 * 健康监测结果Service业务层处理
 * 
 * @author luogongquan
 * @date 2024-09-19
 */
@Service
public class HealthAnalysisResultServiceImpl implements IHealthAnalysisResultService 
{
    @Autowired
    private HealthAnalysisResultMapper healthAnalysisResultMapper;

    /**
     * 查询健康监测结果
     * 
     * @param id 健康监测结果主键
     * @return 健康监测结果
     */
    @Override
    public HealthAnalysisResult selectHealthAnalysisResultById(Long id)
    {
        return healthAnalysisResultMapper.selectHealthAnalysisResultById(id);
    }

    /**
     * 查询健康监测结果列表
     * 
     * @param healthAnalysisResult 健康监测结果
     * @return 健康监测结果
     */
    @Override
    public List<HealthAnalysisResult> selectHealthAnalysisResultList(HealthAnalysisResult healthAnalysisResult)
    {
        return healthAnalysisResultMapper.selectHealthAnalysisResultList(healthAnalysisResult);
    }

    /**
     * 新增健康监测结果
     * 
     * @param healthAnalysisResult 健康监测结果
     * @return 结果
     */
    @Override
    public int insertHealthAnalysisResult(HealthAnalysisResult healthAnalysisResult)
    {
        healthAnalysisResult.setId(PrimaryKeyIdUtils.getSysIdWorker().nextId());
        healthAnalysisResult.setCreateTime(DateUtils.getNowDate());
        return healthAnalysisResultMapper.insertHealthAnalysisResult(healthAnalysisResult);
    }

    /**
     * 修改健康监测结果
     * 
     * @param healthAnalysisResult 健康监测结果
     * @return 结果
     */
    @Override
    public int updateHealthAnalysisResult(HealthAnalysisResult healthAnalysisResult)
    {
        return healthAnalysisResultMapper.updateHealthAnalysisResult(healthAnalysisResult);
    }

    /**
     * 批量删除健康监测结果
     * 
     * @param ids 需要删除的健康监测结果主键
     * @return 结果
     */
    @Override
    public int deleteHealthAnalysisResultByIds(Long[] ids)
    {
        return healthAnalysisResultMapper.deleteHealthAnalysisResultByIds(ids);
    }

    /**
     * 删除健康监测结果信息
     * 
     * @param id 健康监测结果主键
     * @return 结果
     */
    @Override
    public int deleteHealthAnalysisResultById(Long id)
    {
        return healthAnalysisResultMapper.deleteHealthAnalysisResultById(id);
    }
}
